Optimal. Leaf size=112 \[ -\frac{\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac{a \left (2 a^2+b^2\right ) \tanh ^{-1}(\cos (x))}{2 b^4}-\frac{2 a^4 \tanh ^{-1}\left (\frac{a+b \tan \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{b^4 \sqrt{a^2-b^2}}+\frac{a \cot (x) \csc (x)}{2 b^2}-\frac{\cot (x) \csc ^2(x)}{3 b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.406685, antiderivative size = 112, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 9, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.692, Rules used = {3851, 4092, 4082, 3998, 3770, 3831, 2660, 618, 206} \[ -\frac{\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac{a \left (2 a^2+b^2\right ) \tanh ^{-1}(\cos (x))}{2 b^4}-\frac{2 a^4 \tanh ^{-1}\left (\frac{a+b \tan \left (\frac{x}{2}\right )}{\sqrt{a^2-b^2}}\right )}{b^4 \sqrt{a^2-b^2}}+\frac{a \cot (x) \csc (x)}{2 b^2}-\frac{\cot (x) \csc ^2(x)}{3 b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3851
Rule 4092
Rule 4082
Rule 3998
Rule 3770
Rule 3831
Rule 2660
Rule 618
Rule 206
Rubi steps
\begin{align*} \int \frac{\csc ^5(x)}{a+b \csc (x)} \, dx &=-\frac{\cot (x) \csc ^2(x)}{3 b}+\frac{\int \frac{\csc ^2(x) \left (2 a+2 b \csc (x)-3 a \csc ^2(x)\right )}{a+b \csc (x)} \, dx}{3 b}\\ &=\frac{a \cot (x) \csc (x)}{2 b^2}-\frac{\cot (x) \csc ^2(x)}{3 b}+\frac{\int \frac{\csc (x) \left (-3 a^2+a b \csc (x)+2 \left (3 a^2+2 b^2\right ) \csc ^2(x)\right )}{a+b \csc (x)} \, dx}{6 b^2}\\ &=-\frac{\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac{a \cot (x) \csc (x)}{2 b^2}-\frac{\cot (x) \csc ^2(x)}{3 b}+\frac{\int \frac{\csc (x) \left (-3 a^2 b-3 a \left (2 a^2+b^2\right ) \csc (x)\right )}{a+b \csc (x)} \, dx}{6 b^3}\\ &=-\frac{\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac{a \cot (x) \csc (x)}{2 b^2}-\frac{\cot (x) \csc ^2(x)}{3 b}+\frac{a^4 \int \frac{\csc (x)}{a+b \csc (x)} \, dx}{b^4}-\frac{\left (a \left (2 a^2+b^2\right )\right ) \int \csc (x) \, dx}{2 b^4}\\ &=\frac{a \left (2 a^2+b^2\right ) \tanh ^{-1}(\cos (x))}{2 b^4}-\frac{\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac{a \cot (x) \csc (x)}{2 b^2}-\frac{\cot (x) \csc ^2(x)}{3 b}+\frac{a^4 \int \frac{1}{1+\frac{a \sin (x)}{b}} \, dx}{b^5}\\ &=\frac{a \left (2 a^2+b^2\right ) \tanh ^{-1}(\cos (x))}{2 b^4}-\frac{\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac{a \cot (x) \csc (x)}{2 b^2}-\frac{\cot (x) \csc ^2(x)}{3 b}+\frac{\left (2 a^4\right ) \operatorname{Subst}\left (\int \frac{1}{1+\frac{2 a x}{b}+x^2} \, dx,x,\tan \left (\frac{x}{2}\right )\right )}{b^5}\\ &=\frac{a \left (2 a^2+b^2\right ) \tanh ^{-1}(\cos (x))}{2 b^4}-\frac{\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac{a \cot (x) \csc (x)}{2 b^2}-\frac{\cot (x) \csc ^2(x)}{3 b}-\frac{\left (4 a^4\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (1-\frac{a^2}{b^2}\right )-x^2} \, dx,x,\frac{2 a}{b}+2 \tan \left (\frac{x}{2}\right )\right )}{b^5}\\ &=\frac{a \left (2 a^2+b^2\right ) \tanh ^{-1}(\cos (x))}{2 b^4}-\frac{2 a^4 \tanh ^{-1}\left (\frac{b \left (\frac{a}{b}+\tan \left (\frac{x}{2}\right )\right )}{\sqrt{a^2-b^2}}\right )}{b^4 \sqrt{a^2-b^2}}-\frac{\left (3 a^2+2 b^2\right ) \cot (x)}{3 b^3}+\frac{a \cot (x) \csc (x)}{2 b^2}-\frac{\cot (x) \csc ^2(x)}{3 b}\\ \end{align*}
Mathematica [A] time = 1.63056, size = 125, normalized size = 1.12 \[ \frac{\frac{24 a^4 \tan ^{-1}\left (\frac{a+b \tan \left (\frac{x}{2}\right )}{\sqrt{b^2-a^2}}\right )}{\sqrt{b^2-a^2}}+b \left (3 a^2+2 b^2\right ) \cos (3 x) \csc ^3(x)-3 b \cot (x) \csc (x) \left (\left (a^2+2 b^2\right ) \csc (x)-2 a b\right )+6 a \left (2 a^2+b^2\right ) \left (\log \left (\cos \left (\frac{x}{2}\right )\right )-\log \left (\sin \left (\frac{x}{2}\right )\right )\right )}{12 b^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.05, size = 162, normalized size = 1.5 \begin{align*}{\frac{1}{24\,b} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{3}}-{\frac{a}{8\,{b}^{2}} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{2}}+{\frac{{a}^{2}}{2\,{b}^{3}}\tan \left ({\frac{x}{2}} \right ) }+{\frac{3}{8\,b}\tan \left ({\frac{x}{2}} \right ) }+2\,{\frac{{a}^{4}}{{b}^{4}\sqrt{-{a}^{2}+{b}^{2}}}\arctan \left ( 1/2\,{\frac{2\,b\tan \left ( x/2 \right ) +2\,a}{\sqrt{-{a}^{2}+{b}^{2}}}} \right ) }-{\frac{1}{24\,b} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-3}}-{\frac{{a}^{2}}{2\,{b}^{3}} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-1}}-{\frac{3}{8\,b} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-1}}+{\frac{a}{8\,{b}^{2}} \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-2}}-{\frac{{a}^{3}}{{b}^{4}}\ln \left ( \tan \left ({\frac{x}{2}} \right ) \right ) }-{\frac{a}{2\,{b}^{2}}\ln \left ( \tan \left ({\frac{x}{2}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 0.898211, size = 1378, normalized size = 12.3 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\csc ^{5}{\left (x \right )}}{a + b \csc{\left (x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.38737, size = 262, normalized size = 2.34 \begin{align*} \frac{2 \,{\left (\pi \left \lfloor \frac{x}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (b\right ) + \arctan \left (\frac{b \tan \left (\frac{1}{2} \, x\right ) + a}{\sqrt{-a^{2} + b^{2}}}\right )\right )} a^{4}}{\sqrt{-a^{2} + b^{2}} b^{4}} + \frac{b^{2} \tan \left (\frac{1}{2} \, x\right )^{3} - 3 \, a b \tan \left (\frac{1}{2} \, x\right )^{2} + 12 \, a^{2} \tan \left (\frac{1}{2} \, x\right ) + 9 \, b^{2} \tan \left (\frac{1}{2} \, x\right )}{24 \, b^{3}} - \frac{{\left (2 \, a^{3} + a b^{2}\right )} \log \left ({\left | \tan \left (\frac{1}{2} \, x\right ) \right |}\right )}{2 \, b^{4}} + \frac{44 \, a^{3} \tan \left (\frac{1}{2} \, x\right )^{3} + 22 \, a b^{2} \tan \left (\frac{1}{2} \, x\right )^{3} - 12 \, a^{2} b \tan \left (\frac{1}{2} \, x\right )^{2} - 9 \, b^{3} \tan \left (\frac{1}{2} \, x\right )^{2} + 3 \, a b^{2} \tan \left (\frac{1}{2} \, x\right ) - b^{3}}{24 \, b^{4} \tan \left (\frac{1}{2} \, x\right )^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]